﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Elderos.Clustering
{
    public class Cluster<T> : List<ClusterElement<T>>
    {
        private readonly Func<List<T>, T> _getCenterFunction;

        public T Centroid
        {
            get
            {
                return _getCenterFunction(this.Select(x => x.InnerElement).ToList());
            }
        }

        public Cluster(Func<List<T>,T> getCenterFunction)
        {
            _getCenterFunction = getCenterFunction;
        }
    }
}
